﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Buccontrols;
using PluginInterface;
using Buccaneer;
using System.IO;

namespace NotepadPlugin
{
    public class CloseAction: PluginAction
    {
        public CloseAction(IPlugin plugin)
        {
            base.name = "close";
            base.func = new ActionFunction(this.ClosePlugin);
            base.exceptions.Add("System.IO.IOException", new ActionFunction(CloseError));
            base.plugin = plugin;
        }

        public void ClosePlugin(string[] args)
        {
            // dit is de functie
            base.plugin.MainInterface.Close();
        }

        public void CloseError(string[] args)
        {
            Options.WriteComment("Er ging iets mis bij het sluiten van de plugin.");
        }
    }
}
